package com.kuaimacode.kframework.admin.services.category;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kuaimacode.kframework.mybatis.mapper.category.BuyIconMapper;
import com.kuaimacode.kframework.mybatis.models.category.BuyIcon;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author anzy
 * @date 2019/05/09
 */
@Service
public class  BuyIconService extends ServiceImpl<BuyIconMapper, BuyIcon> {

    	/**
    	 *  分页查找所有的数据
    	 * @param pageNum 当前页码，从1开始
    	 * @param pageSize  一页显示多少行
    	 * @return
    	 */
    	public PageInfo<BuyIcon> findAll(int pageNum, int pageSize) {
    		PageHelper.startPage(pageNum, pageSize);
    		List<BuyIcon> datas = baseMapper.selectList(null);
    		return new PageInfo<BuyIcon>(datas);
    	}

	public List<BuyIcon> findAll() {
		return baseMapper.selectList(null);
	}
}

